import Vue from 'vue';
import VueRouter from 'vue-router';
import examplesList from "../examples/index";

Vue.use(VueRouter)

const routes = 
examplesList().map((component,index) => ({
	path: index == 0 ? '/' : `/${component.name}`,
	name: `${component.name}`,
	component: component
}))

const router = new VueRouter({
	mode: 'history',
	base: process.env.BASE_URL,
	routes
})

export default router
